<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    function Student(name,age,score) {
        this.name=name;
        this.age=age;
        this.score=score;
    }
    // '在原型对象上面挂载'不会改变原型对象
    // 这样我们知道,这个原型是Student构造函数构造出来的,现成的,不需要再去手动创建的
    Student.prototype.sayhi = function() {
        console.log("嗨咯来了")
    }
    Student.prototype.wo = function() {
        console.log("wowowoo")
    }
    // var s2 = new Student("zs",33,90)
    console.dir(Student.prototype)   // sayhi/wo/constructor/__proto__
   
    Student.prototype = {
        constructor:Student,  //手动额属性添加yig
        rrr:function() {
            console.log(11111)
        },
        dd:function() {
            console.log(4444)
        }
    }
    console.dir(Student.prototype)    //rrr/dd/__proto__/没有constructor,他的
    var s1 = new Student("zs",12,90)
    console.dir(s1)
    console.dir(s1.constructor)  //只会去远行恋曲查找
    // var s2 = new Student("zs",33,90)
    // console.dir(s1.constructor)
    // console.dir(s2)
    // console.dir(Student.prototype)
    
    // console.dir(s1.constructor)  //指向Student
    </script>
</body>
</html>